
<script>
import { h } from 'vue'
export default {
  name: 'XtxBread',
  render () {
    // 获取插槽
    const arry = this.$slots.default()
    const arryitem = []
    arry.forEach((item, i) => {
      arryitem.push(item)
      if (i < arry.length - 1) {
        arryitem.push(h('i', { class: 'iconfont icon-angle-right' }))
      }
    })
    // h函数创建一个类名为xtx-bread的div标签
    return h('div', { class: 'xtx-bread' }, arryitem)
  }
}
</script>

<style lang="less">
.xtx-bread{
  display: flex;
  padding:20px 10px;
  &-item{
    a{
      color: #666;
      transition: all .4s;
      &:hover{
        color:@xtxColor;
      }
    }
  }
  i{
    font-size: 12px;
    margin-left:5px;
    margin-right:5px;
    line-height: 22px;
    &:last-child{
      display: none;
    }

  }
}
</style>
